#include <iostream>
#include <typeinfo>
using namespace std;

class A
{
public:
     virtual void Print() { cout<<"This is class A."<<endl; }
    void Show() {cout<<"show class A"<<endl;}
};

class B
{
public:
     virtual void Print() { cout<<"This is class B."<<endl; }
     void Show(int a) {cout<<"show class B"<<endl;}
};

class C : public A, public B
{
public:
     void Print() { cout<<"This is class C."<<endl; }
    void Show() {cout<<"show class C"<<endl;}

};

int main()
{
     A *pA = new C;
     pA->Show();
     cout<<typeid(pA).name()<<endl;
     cout<<typeid(*pA).name()<<endl;
     //C *pC = pA; // Wrong 编译器会提示错误
     C *pC = dynamic_cast<C *>(pA);
     pC->B::Show(1);
     if (pC != NULL)
     {
          pC->Print();
     }
     delete pA;
}